<template>
  <div class="home">
    <h2>Home View</h2>
    <h2>count：{{userStore.count}}</h2>
    <button @click="changeState">修改count</button>

    <!--展示数据-->
    <h2>轮播的数据</h2>
    <ul>
      <template v-for="item in homeStore.banners">
        <li>{{item.title}}</li>
      </template>
    </ul>
  </div>
</template>

<script setup>
 import userCounter from "../stores/counter.js"
 import useHome from '../stores/home.js'
 const userStore=userCounter()
 function changeState(){
   // userStore.increment()
   userStore.incrementNum(10)
 }

 const homeStore=useHome()
 homeStore.fetchHomeMultidata()
     .then(res=>{
       console.log("fetchHomeMultidata的action已经完成了:",res)
     })

</script>